package main

import (
	"fmt"
	"net/rpc"
)

/*
1、自定义一个函数
2、注册到rpc
3、rpc 启动

*/

func main() {

	client, err := rpc.Dial("tcp", "localhost:1234")
	if err != nil {
		panic(err)
	}

	var reply int
	err = client.Call("HelloRpcServer.ADD", 3, &reply)
	if err != nil {
		panic(err)
	}
	fmt.Println(reply)

	var result string

	err = client.Call("HelloRpcServer.Hello", "hello_world ", &result)
	if err != nil {
		panic(err)
	}
	fmt.Println(result)

}
